package day16_Runnable.demo07_ExecutorService;

//线程池:
//	写法:创建多个线程
//		ExecutorService threadPool = Executors.newFixedThreadPool(8);
//	启动线程
//		threadPool.submit(Runnable对象)
//	关闭线程池
//		threadPool.shutdown();

import day16_Runnable.demo06_synchronized.MyThread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Test {
    public static void main(String[] args) {
        ExecutorService threadPool = Executors.newFixedThreadPool(8);
        Csw csw = new Csw();
        for (int i = 1; i <=8 ; i++) {
            threadPool.submit(csw);
        }
        threadPool.shutdown();
    }
}
